package com.broada.apm.model;


/**
 * index_type 条件封装
 * 
 * @author louyi Create By Dec 22, 2014 10:39:18 AM
 */
public enum Scope {

	APMRUNNING_APMLOGS("apm_logs","apmlogs"),
	APMRUNNING_APMDATA("apm_data","raw"),
	APMRUNNING_PERFS("apm_perf","perf"),
	APMRUNNING_ERRORS("apm_error","errors"),
	APMRUNNING_TRANS("apm_tran","transactions"),
	APMRUNNING_TRANSDETAIL("apm_trade_detail","trade_detail"),
	APMRUNNING_ERROR_DETAIl("apm_detail_error","detail_error"),
	
	APM_PINPOINT_SPAN("pinpoint_span","span_detail");
	private String index,type;

	private Scope(String index, String type) {
		this.type=type;
		this.index=index;
	}
	public static Scope check(String type) {
		for (Scope mapping : values()) {
			if (mapping.getType().equals(type))
				return mapping;
		}
		throw new IllegalArgumentException("未知的IndicesType：" + type);
	}
	
	public String getType() {
		return type;
	}
	public void setType(String type) {
		this.type = type;
	}
	public String getIndex() {
		return index;
	}
	public void setIndex(String index) {
		this.index = index;
	}

}
